
export const changeUserinfo = ((params = {}) => {
    return new Promise((resolve, reject) => {
        wx.showLoading({
            title: '加载中',
        })
        // 从本地缓存中获取 token
        const token = wx.getStorageSync('token');

        wx.uploadFile({
            filePath: params.filepath,
            name: 'file',
            url: 'http://127.0.0.1:8080/api/upavator',
            header: {
                token: token
            },
            formData: {
                nickname: params.nickname,
                introduct: params.introduct,
                collage:params.collage,
                grade:params.grade
            },
            success: (res) => {
                // console.log("用户信息上传成功", res);
                resolve(res)
            },
            fail: (res) => {
                console.log("用户信息上传失败", res);
                reject(res)
            },complete:() => {
                wx.hideLoading()
            }
        })
    })

})